﻿Imports Mysoft.Map.Application.Controls
Imports MySoft.Map.Service
Imports Mysoft.PubProject.Business

Partial Public Class NoticeWebpart
    Inherits Mysoft.Map.Application.Security.AppPage

    Private _ntcCount As Integer = 0
    Protected ReadOnly Property NoticeCount() As Integer
        Get
            Return _ntcCount
        End Get
    End Property
    Private _reqCount As Integer = 0
    Protected ReadOnly Property RequestCount() As Integer
        Get
            Return _reqCount
        End Get
    End Property
    Private _isAutoScroll As Boolean = False
    Protected ReadOnly Property IsAutoScroll() As Integer
        Get
            Return _isAutoScroll
        End Get
    End Property
    Private _readInterval As Integer = 1
    Protected ReadOnly Property ReadInterval() As Integer
        Get
            Return _readInterval
        End Get
    End Property
Private _lastReadTime As string = ""
    Protected ReadOnly Property ReadlastReadTime() As String
        Get
            Return _lastReadTime
        End Get
    End Property
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.EnableViewState = False
        Dim userguid = Session("UserGUID").ToString()
        Dim rinterval As Integer
        Integer.TryParse(Request.QueryString("read"), rinterval)
        If rinterval > 0 Then
            _readInterval = rinterval
        End If
        Dim scroll = Request.QueryString("scroll")
        If scroll IsNot Nothing AndAlso scroll = "1" Then
            _isAutoScroll = True
        End If
        _lastReadTime = PublicMNG.GetSysdate("yyyy-mm-dd hh:mm:ss")
        Dim data = Message.GetData()
        If data.Rows.Count > 0 Then
            _ntcCount = data.Select("MessageMode=0").Length
            _reqCount = data.Select("MessageMode=1").Length
        End If
        Me.rptNotice.DataSource = data
        Me.rptNotice.DataBind()

    End Sub

End Class